watchcat: fix argument handling and allow multiple ping hosts
authorIvan Diaz <[email protected]>
Fri, 21 Nov 2025 22:13:11 +0000 (17:13 -0500)
committerHannu Nyman <[email protected]>
Tue, 9 Dec 2025 11:12:19 +0000 (12:12 +0100)
The backend now correctly supports multiple IP addresses and avoids
argument shifting when mmifacename is empty.

Signed-off-by: Ivan Diaz <[email protected]>
utils/watchcat/Makefile
utils/watchcat/files/watchcat.init

index 8140edfe00f3a0d227e64f7beb28979a9497b9ee..8541672e8d74e0641431390f2d4980ce75007985 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=watchcat
 PKG_VERSION:=1
-PKG_RELEASE:=17
+PKG_RELEASE:=18
 
 PKG_MAINTAINER:=Roger D <[email protected]>
 PKG_LICENSE:=GPL-2.0
index 688b44bb8cf444f70eda6900282119601711be88..a21712e1f545f5006b9187cd9b748686a635d7cf 100644 (file)
@@ -38,8 +38,8 @@ config_watchcat() {
        config_get pingperiod "$1" pingperiod "60"
        config_get forcedelay "$1" forcedelay "60"
        config_get pingsize "$1" pingsize "standard"
-       config_get interface "$1" interface
-       config_get mmifacename "$1" mmifacename
+       config_get interface "$1" interface # CHEK only if need a default?
+       config_get mmifacename "$1" mmifacename # FIX HERE need a default?
        config_get_bool unlockbands "$1" unlockbands "0"
        config_get addressfamily "$1" addressfamily "any"
        config_get script "$1" script
@@ -104,19 +104,19 @@ config_watchcat() {
                ;;
        ping_reboot)
                procd_open_instance "watchcat_${1}"
-               procd_set_param command /usr/bin/watchcat.sh "ping_reboot" "$period" "$forcedelay" "$pinghosts" "$pingperiod" "$pingsize" "$addressfamily"
+               procd_set_param command /usr/bin/watchcat.sh "ping_reboot" "$period" "$forcedelay" \"$pinghosts\" "$pingperiod" "$pingsize" "$addressfamily"
                procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
                procd_close_instance
                ;;
        restart_iface)
                procd_open_instance "watchcat_${1}"
-               procd_set_param command /usr/bin/watchcat.sh "restart_iface" "$period" "$pinghosts" "$pingperiod" "$pingsize" "$interface" "$mmifacename" "$unlockbands" "$addressfamily"
+               procd_set_param command /usr/bin/watchcat.sh "restart_iface" "$period" \"$pinghosts\" "$pingperiod" "$pingsize" "$interface" "$mmifacename" "$unlockbands" "$addressfamily"
                procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
                procd_close_instance
                ;;
        run_script)
                procd_open_instance "watchcat_${1}"
-               procd_set_param command /usr/bin/watchcat.sh "run_script" "$period" "$pinghosts" "$pingperiod" "$pingsize" "$interface" "$addressfamily" "$script"
+               procd_set_param command /usr/bin/watchcat.sh "run_script" "$period" \"$pinghosts\" "$pingperiod" "$pingsize" "$interface" "$addressfamily" "$script"
                procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
                procd_close_instance
                ;;